<form id="pagerForm" method="post" action="{:U($module_name.'/'.$action_name."?model=".$model)}">
    <input type="hidden" name="pageNum" value="{$pageNum}" />
    <input type="hidden" name="numPerPage" value="{$numPerPage}" />
    <input type="hidden" name="orderField" value="{$orderField}" />
    <input type="hidden" name="orderDirection" value="{$orderDirection}" />
	<input type='hidden' name='listkey' value='{$listkey}' />
	<input type='hidden' name='keywords' value='{$keywords}' />
	<input type='hidden' name='sfield' value='{$sfield}' />
	<input type="hidden" name="sfield_name" value="name" />	
</form>
<div class="pageHeader">
    <form rel="pagerForm" onsubmit="return navTabSearch(this);" action="" method="post">
    <input type="hidden" name="g" value="{$group_name}" />
		<input type="hidden" name="a" value="{$action_name}" />
       <input type ='hidden' name='selproid' value="{$selproid}" />
		<div class="searchBar">
            <ul class="searchContent">
                <li style="width:200px;">
                <label style="width: 50px;">关键字：</label>
                <input type="text" name="keywords" value="{$keywords}"/>
                </li>
                <li style="width: 100px;">
                <select class="combox" name="sfield">
                	<option value="" >请选择</option>
                	<option value="id" {if $sfield== 'id'} selected='selected'{/if} >用户ID</option>
                    <option value="username" {if $sfield== 'username'} selected='selected'{/if}>用户名</option>
					 <option value="mobile" {if $sfield== 'mobile'} selected='selected'{/if}>手机</option>
                </select>
				<input type="hidden" name="sfield_name" value="id,username,mobile" />					
                </li>
				<!--	
				<li>
					状态：
					<select name="status">
						<option value='1' selected>进行中</option>
						<option value='0'>已结束</option>
					</select>
				</li>
				-->
                <li style="padding-top:0;"><div class="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
            </ul>
        </div>
    </form>
</div>
<div class="pageContent">

	<table class="table" width="100%" layoutH="88">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="ids[]" class="checkboxCtrl"></th>
				<th width='250px;' orderField="id" {if $orderField=='id'}class="{$orderDirection}"{/if}>用户</th>
				<th width='100px;' orderField="mobile" {if $orderField=='mobile'}class="{$orderDirection}"{/if}>手机</th>
				<th width='300px;' orderField="CV" {if $orderField=='CV'}class="{$orderDirection}"{/if}>CV：[ <font color='red'>{$sum.CV}</font> ]</th>
				<th width='300px;' orderField="BV" {if $orderField=='BV'}class="{$orderDirection}"{/if}>BV：[ <font color='red'>{$sum.BV}</font> ]</th>
				<th width='300px;' orderField="PV" {if $orderField=='PV'}class="{$orderDirection}"{/if}>PV：[ <font color='red'>{$sum.PV}</font> ]</th>
				<th width='300px;' orderField="MV" {if $orderField=='MV'}class="{$orderDirection}"{/if}>MV：[ <font color='red'>{$sum.MV}</font> ]</th>	
				<th width='300px;' orderField="CNY" {if $orderField=='CNY'}class="{$orderDirection}"{/if}>CNY：[ <font color='red'>{$sum.CNY}</font> ]</th>							
			</tr>
		</thead>
		<tbody>	
		<volist name='list' id='vo'>
			<tr target="sid_user" rel="9">
				<td><input name="ids[]" class="chpro" value="{$vo['changtype']}|{$vo['subject']}" type="checkbox"></td>
				<td>
					  <a title="查看" target="dialog" width="580" height="500" rel="User_detail_{$vo['id']}" href="{:U('User/detail',array('id'=>$vo['id']))}">{$vo.id}({$vo.username})</a></td>
				<td>{$vo.mobile}</td>
				<td>{if $vo['CV']}{$vo['CV']}{else}0{/if}</td>
				<td>{if $vo['BV']}{$vo['BV']}{else}0{/if}</td>
				<td>{if $vo['PV']}{$vo['PV']}{else}0{/if}</td>
				<td>{if $vo['MV']}{$vo['MV']}{else}0{/if}</td>
				<td>{if $vo['CNY']}{$vo['CNY']}{else}0{/if}</td>
		</tr>
		</volist>
			
		</tbody>
	</table>
	<include file="Index:pages" />
</div>

<script>	
function ajaxTodo(url){
	$.ajax({
		type: 'POST',
		url: url,
		dataType: "json",
		cache: false,
		success: function(){ $("a", $(".j-num")).parent('.selected').children().click();return 0; },
		error: DWZ.ajaxError
	});
}

if(typeof('showFace')!="function"){
	var time = "";
		if($("#stime").val()!=""){
			 time += "&starttime="+$("#stime").val();
		}
		if($("#etime").val()!=""){
			 time += "&endtime="+$("#etime").val();
		}
function navTabAjaxDone(json){
    if (json.action == 'piechart'){	
		var todo = json.ftodo;
		var url = "{:U('Assetsreport/piechart',array('todo'=>'piechart'))}" + '&ids='+json.ids +'&ftodo='+json.ftodo+time;
		$("#forstautss").attr('href',url);
        $("#forstautss").click();
    }else if (json.action == 'barchart'){
		var todo = json.ftodo;
		var url = "{:U('Assetsreport/barchart',array('todo'=>'barchart'))}" + '&ids='+json.ids +'&ftodo='+json.ftodo+time;
		$("#forstautss").attr('href',url);
        $("#forstautss").click();
	}
	else {
		DWZ.ajaxDone(json);
		navTab.reload();
	}
}

}
</script>
